//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class TextTabStop : IOfficeXmlSerializable
    {
        private TextTabAlignmentType algn;
        private int pos; //\\

        public int Position
        {
            get { return pos; }
            set { pos = value; }
        }

        public TextTabAlignmentType Alignment
        {
            get { return algn; }
            set { algn = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("tab"))
            {
                Position = c.GetOptionalInteger("pos", 0);
                Alignment = c.GetOptionalEnum("algn", TextTabAlignmentType.Left); //\\
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("tab"))
            {
                c.SetOptionalInteger("pos", Position, 0);
                c.SetOptionalEnum("algn", Alignment, TextTabAlignmentType.Left); //\\
            }
        }

        #endregion
    }
}